#pragma once

namespace sf
{
    class PostFX;
}
class DIRenderer;

namespace Postprocesses {

class DIPostprocess;

typedef std::map<std::string, boost::shared_ptr<sf::PostFX> > EffectsMap;

class DPostprocessManager
{
public:
    static DPostprocessManager& instance();
    void init();

    bool isSupported();

    void update(float dt);
    void render(boost::shared_ptr<DIRenderer> renderer);

    void activateFadeIn(float fSpeed);
    void activateFadeOut(float fSpeed);
	void activateBlast(float duration, const vec2& originScreen);
private:
    DPostprocessManager(void);
    ~DPostprocessManager(void);
    bool addEffect(const std::string& name);
    EffectsMap m_effects;
    bool m_bEffectsSupported;

    boost::shared_ptr<DIPostprocess> m_ppFade;
	boost::shared_ptr<DIPostprocess> m_ppWaveblast;
};

} // namespace Postprocesses {

typedef Postprocesses::DPostprocessManager PostprocessManager;